<?php

 //header("Content-type: text/json");
        
        $valor = array();
        
        //array_push($valores, array(1347508805000,3.660887));
        
        $file_handle = fopen("conf.txt", "r");
        $line = split(":",fgets($file_handle));

        $hostname= $line[0];
        $db_user= $line[1];
        $db_pass= $line[2];
        $db_name= chop($line[3]);

        fclose($file_handle);
        
        $con = mysql_connect($hostname,$db_user,$db_pass);
        
        if (!$con)
        {
            die('Could not connect: ' . mysql_error());
        }
        date_default_timezone_set('UTC');
        mysql_select_db($db_name, $con);
                    
        $sql = mysql_query('SELECT valores FROM params WHERE nombre= "' .$_GET['param'].'";');
           
        while($row = mysql_fetch_array($sql))
             {
                array_push($valor, array($row[0]));
             }  
        
                    
        mysql_close($con);
        echo json_encode($valor);
?>
